package work.comeback.omo.model.movie.detail;

import com.google.gson.annotations.SerializedName;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

@Data
public class MovieDetailData {
    @SerializedName("vod_id")
    private int vodId;
    @SerializedName("type_id")
    private int typeId;
    @SerializedName("type_id_1")
    private int typeId1;
    @SerializedName("group_id")
    private int groupId;
    @SerializedName("vod_name")
    private String vodName;
    @SerializedName("vod_sub")
    private String vodSub;
    @SerializedName("vod_en")
    private String vodEn;
    @SerializedName("vod_status")
    private int vodStatus;
    @SerializedName("vod_letter")
    private String vodLetter;
    @SerializedName("vod_color")
    private String vodColor;
    @SerializedName("vod_tag")
    private String vodTag;
    @SerializedName("vod_class")
    private String vodClass;
    @SerializedName("vod_pic")
    private String vodPic;
    @SerializedName("vod_pic_thumb")
    private String vodPicThumb;
    @SerializedName("vod_pic_slide")
    private String vodPicSlide;
    @SerializedName("vod_pic_screenshot")
    private String vodPicScreenshot;
    @SerializedName("vod_actor")
    private String vodActor;
    @SerializedName("vod_director")
    private String vodDirector;
    @SerializedName("vod_writer")
    private String vodWriter;
    @SerializedName("vod_behind")
    private String vodBehind;
    @SerializedName("vod_blurb")
    private String vodBlurb;
    @SerializedName("vod_remarks")
    private String vodRemarks;
    @SerializedName("vod_pubdate")
    private String vodPubdate;
    @SerializedName("vod_total")
    private int vodTotal;
    @SerializedName("vod_serial")
    private String vodSerial;
    @SerializedName("vod_tv")
    private String vodTv;
    @SerializedName("vod_weekday")
    private String vodWeekday;
    @SerializedName("vod_area")
    private String vodArea;
    @SerializedName("vod_lang")
    private String vodLang;
    @SerializedName("vod_year")
    private String vodYear;
    @SerializedName("vod_version")
    private String vodVersion;
    @SerializedName("vod_state")
    private String vodState;
    @SerializedName("vod_author")
    private String vodAuthor;
    @SerializedName("vod_jumpurl")
    private String vodJumpurl;
    @SerializedName("vod_tpl")
    private String vodTpl;
    @SerializedName("vod_tpl_play")
    private String vodTplPlay;
    @SerializedName("vod_tpl_down")
    private String vodTplDown;
    @SerializedName("vod_isend")
    private int vodIsend;
    @SerializedName("vod_lock")
    private int vodLock;
    @SerializedName("vod_level")
    private int vodLevel;
    @SerializedName("vod_copyright")
    private int vodCopyright;
    @SerializedName("vod_points")
    private int vodPoints;
    @SerializedName("vod_points_play")
    private int vodPointsPlay;
    @SerializedName("vod_points_down")
    private int vodPointsDown;
    @SerializedName("vod_hits")
    private int vodHits;
    @SerializedName("vod_hits_day")
    private int vodHitsDay;
    @SerializedName("vod_hits_week")
    private int vodHitsWeek;
    @SerializedName("vod_hits_month")
    private int vodHitsMonth;
    @SerializedName("vod_duration")
    private String vodDuration;
    @SerializedName("vod_up")
    private int vodUp;
    @SerializedName("vod_down")
    private int vodDown;
    @SerializedName("vod_score")
    private String vodScore;
    @SerializedName("vod_score_all")
    private int vodScoreAll;
    @SerializedName("vod_score_num")
    private int vodScoreNum;
    @SerializedName("vod_time")
    private String vodTime;
    @SerializedName("vod_time_add")
    private long vodTimeAdd;
    @SerializedName("vod_time_hits")
    private int vodTimeHits;
    @SerializedName("vod_time_make")
    private int vodTimeMake;
    @SerializedName("vod_trysee")
    private int vodTrysee;
    @SerializedName("vod_douban_id")
    private long vodDoubanId;
    @SerializedName("vod_douban_score")
    private String vodDoubanScore;
    @SerializedName("vod_reurl")
    private String vodReurl;
    @SerializedName("vod_rel_vod")
    private String vodRelVod;
    @SerializedName("vod_rel_art")
    private String vodRelArt;
    @SerializedName("vod_pwd")
    private String vodPwd;
    @SerializedName("vod_pwd_url")
    private String vodPwdUrl;
    @SerializedName("vod_pwd_play")
    private String vodPwdPlay;
    @SerializedName("vod_pwd_play_url")
    private String vodPwdPlayUrl;
    @SerializedName("vod_pwd_down")
    private String vodPwdDown;
    @SerializedName("vod_pwd_down_url")
    private String vodPwdDownUrl;
    @SerializedName("vod_content")
    private String vodContent;
    @SerializedName("vod_play_from")
    private String vodPlayFrom;
    @SerializedName("vod_play_server")
    private String vodPlayServer;
    @SerializedName("vod_play_note")
    private String vodPlayNote;
    @SerializedName("vod_play_url")
    private String vodPlayUrl;
    @SerializedName("vod_down_from")
    private String vodDownFrom;
    @SerializedName("vod_down_server")
    private String vodDownServer;
    @SerializedName("vod_down_note")
    private String vodDownNote;
    @SerializedName("vod_down_url")
    private String vodDownUrl;
    @SerializedName("vod_plot")
    private int vodPlot;
    @SerializedName("vod_plot_name")
    private String vodPlotName;
    @SerializedName("vod_plot_detail")
    private String vodPlotDetail;
    @SerializedName("type_name")
    private String typeName;

    /**
     * 获取播放地址（Key-Value 格式）
     */
    public Map<String, String> getPlayUrls() {
        Map<String, String> playUrls = new HashMap<>();
        if (vodPlayUrl != null) {
            String[] entries = vodPlayUrl.split("\\$\\$\\$");
            for (String entry : entries) {
                String[] episodes = entry.split("#");
                for (String episode : episodes) {
                    String[] pair = episode.split("\\$");
                    if (pair.length == 2) {
                        playUrls.put(pair[0], pair[1]);
                    }
                }
            }
        }
        return playUrls;
    }
}
